import Decimal from 'decimal.js'
import { InferAttributes } from 'sequelize'
import { Column, DataType, Model, PrimaryKey, Table } from 'sequelize-typescript'

@Table({ tableName: 'fj_blind_box_gift', underscored: true, timestamps: false })
export class BlindBoxGift extends Model<InferAttributes<BlindBoxGift>> {
    @PrimaryKey
    @Column
    declare id: number

    @Column
    declare is_del: number

    @Column({
        type: DataType.DECIMAL,
        get() {
            return new Decimal(this.getDataValue('price') ?? 0)
        },
    })
    declare price: Decimal

    @Column
    declare title: string

    @Column
    declare image: string

    @Column
    declare level: number

    @Column
    declare dealer_id: number

    @Column
    declare probability: string

    @Column
    declare currency_id: string

    probability_num = 0

    range_start = 0

    range_end = 0
}
